{% extends "Froxlor/base.html.twig" %}

{% block content %}
	<div class="container">
		<div class="row justify-content-center">
			<form class="col-12 max-w-420 d-flex flex-column" method="post" enctype="application/x-www-form-urlencoded">
				<img class="align-self-center my-5" src="{{ header_logo_login }}" alt="Froxlor Server Management Panel"/>

				<div class="card shadow">
					<div class="card-body">
						<h5 class="card-title">{{ pagetitle }}</h5>
						<p>{{ lng('login.welcomemsg') }}</p>

						{% if upd_in_progress %}
							<div class="alert alert-warning" role="alert">
								{{ lng('update.updateinprogress_onlyadmincanlogin')|raw }}
							</div>
						{% elseif successmsg is not empty %}
							<div class="alert alert-success" role="alert">
								<h4 class="alert-heading">{{ lng('success.success') }}</h4>
								<p>{{ successmsg|raw }}</p>
							</div>
						{% elseif message is not empty %}
							<div class="alert alert-danger" role="alert">
								<h4 class="alert-heading">{{ lng('error.error') }}</h4>
								<p>{{ message|raw }}</p>
							</div>
						{% endif %}

						<div class="mb-3">
							<label for="loginname" class="col-form-label">{{ lng('login.username') }}</label>
							<input class="form-control" type="text" name="loginname" id="loginname" value="" required autofocus/>
						</div>

						<div class="mb-3">
							<label for="password" class="col-form-label">{{ lng('login.password') }}</label>
							<input class="form-control" type="password" name="password" id="password" value="" required/>
						</div>
					</div>

					<div class="card-body d-grid gap-2">
						<button class="btn btn-primary" type="submit" name="dologin">{{ lng('login.login') }}</button>
					</div>

					{% if get_setting('panel.allow_preset') == '1' %}
						<div class="card-footer">
							<a class="card-link text-body-secondary" href="index.php?action=forgotpwd">{{ lng('login.forgotpwd') }}</a>
						</div>
					{% endif %}
				</div>
			</form>
		</div>
	</div>
{% endblock %}
